<template>
  <el-form ref="ruleForm" v-loading="loading" :rules="ruleForm" :model="formInfo" label-position="left" label-width="130px">
    <el-row :gutter="20">
      <el-col :span="8">
        <el-form-item label="租赁标的名称" prop="name">
          <el-input v-model="formInfo.name" placeholder="请输入租赁标的名称" />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="标的编码" prop="code">
          <el-input v-model="formInfo.code" placeholder="请输入标的编码" />
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="备注" prop="remark">
          <el-input v-model="formInfo.remark" :rows="5" type="textarea" placeholder="请输入备注" />
        </el-form-item>
      </el-col>
    </el-row>
    <el-tabs v-model="activeName" :class="{ 'no-allow': isAdd }">
      <div v-if="isAdd" class="no-allow-text">请保存草稿后操作</div>
      <el-tab-pane label="附件上传" name="file">
        123123
      </el-tab-pane>
    </el-tabs>
  </el-form>
</template>

<script>
export default {
  name: 'LeasedObjectDetail',
  props: {
    loading: Boolean,
    isAdd: Boolean
  },
  data() {
    return {
      formInfo: {},
      activeName: 'file',
      ruleForm: {
        name: [
          { required: true, message: '请输入租赁标的名称', trigger: 'blur' }
        ],
        company_id: [
          { required: true, message: '请选择所属公司', trigger: 'blur' }
        ],
        type: [
          { required: true, message: '请选择租赁标的类型', trigger: 'blur' }
        ],
        cost_center_code: [
          { required: true, message: '公司代码+0000+标的代码', trigger: 'blur' }
        ]
      }
    }
  }
}
</script>
